package com.scf.fruit.business.useraddress.bo;

import com.github.pagehelper.PageHelper;
import com.scf.fruit.useraddress.UserAddressDto;
import com.scf.fruit.useraddress.UserAddressService;
import com.scf.fruit.util.ResponseVo;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author : 孙超飞
 * @title :
 * @description :
 * @copyright :
 * @date : 2018-05-22 14:11
 */
@Component
public class UserAddressBo {
    @Resource
    private UserAddressService userAddressService;

    public ResponseVo queryUserAddressByPage(Integer pageNum,Integer length){
       ResponseVo res=new ResponseVo();
        PageHelper.startPage(pageNum,length,false);
        List<UserAddressDto> userAddressDtos = userAddressService.queryUserAddressAll();
        res.setData(userAddressDtos);
        return res;
    }
}
